module(
    name = "rules_bazel_integration_test",
    version = "0.33.2",
)

bazel_dep(name = "bazel_skylib", version = "1.7.1")
bazel_dep(name = "rules_python", version = "0.40.0")
bazel_dep(name = "platforms", version = "0.0.10")
bazel_dep(name = "cgrindel_bazel_starlib", version = "0.27.0")
bazel_dep(name = "rules_shell", version = "0.3.0")

# not a direct dependency, but required here for bazel starlib's difftest
# macros to work
bazel_dep(
    name = "buildifier_prebuilt",
    version = "6.1.2",
)

register_toolchains("@bazel_tools//tools/python:autodetecting_toolchain")

# Must keep the Bazel version listed in WORKSPACE in sync with those loaded
# below.
bazel_binaries = use_extension(
    "//:extensions.bzl",
    "bazel_binaries",
    dev_dependency = True,
)
bazel_binaries.download(version_file = "//:.bazelversion")

# GH466: Disable last green while we investigate
# bazel_binaries.download(version = "last_green")
bazel_binaries.local(path = "tools/fake_bazel.sh")
use_repo(
    bazel_binaries,
    "bazel_binaries",
    "bazel_binaries_bazelisk",
    "build_bazel_bazel_.bazelversion",
    # GH466: Disable last green while we investigate
    # "build_bazel_bazel_last_green",
    "build_bazel_bazel_local",
)

download_sample_file = use_extension(
    "//examples/env_var_with_rootpath:sample_file_extension.bzl",
    "download_sample_file",
    dev_dependency = True,
)
use_repo(download_sample_file, "sample_file")
